package org.epidroid.epidroid.chronos.engine.objects;

import java.util.List;

import org.epidroid.epidroid.chronos.engine.utils.ChronosUtils;

public class ChronosCourse implements Printable {

	private String _id = null;
	private String _title = null;
	private String _hour = null;
	private String _duration = null;
	private List<ChronosInstructor> _instructors = null;
	private List<ChronosTrainee> _trainees = null;
	private List<ChronosRoom> _rooms = null;

	/*
	 * Defines the position of the event in its own column. The number
	 * corresponds to the number of time the width of the column is divided. The
	 * resulting offset is the left margin of the event.
	 */
	private Integer _displayDiv = 0;
	private ChronosCourse _displayOverlappingCourse = null;

	public ChronosCourse(String id, String title, String hour, String duration) {
		_id = id;
		_title = title;
		_hour = hour;
		_duration = duration;
	}

	public String getId() {
		return _id;
	}

	public String getTitle() {
		return _title;
	}

	public String getHour() {
		return _hour;
	}

	public String getDuration() {
		return _duration;
	}

	public List<ChronosInstructor> getInstructors() {
		return _instructors;
	}

	public List<ChronosTrainee> getTrainees() {
		return _trainees;
	}

	public List<ChronosRoom> getRooms() {
		return _rooms;
	}

	public void setInstructors(List<ChronosInstructor> i) {
		_instructors = i;
	}

	public void setTraiees(List<ChronosTrainee> t) {
		_trainees = t;
	}

	public void setRooms(List<ChronosRoom> r) {
		_rooms = r;
	}

	public void print(Integer indent) {
		ChronosUtils.printWithIndent(indent, "Course:");
		indent += 4;
		ChronosUtils.printWithIndent(indent, "id: " + _id);
		ChronosUtils.printWithIndent(indent, "title: " + _title);
		ChronosUtils.printWithIndent(indent, "hour: " + _hour);
		ChronosUtils.printWithIndent(indent, "duration: " + _duration);
		ChronosUtils.printWithIndent(indent, "Instructors:");
		for (ChronosInstructor i : _instructors) {
			i.print(indent + 4);
		}
		ChronosUtils.printWithIndent(indent, "Trainnees:");
		for (ChronosTrainee t : _trainees) {
			t.print(indent + 4);
		}
		ChronosUtils.printWithIndent(indent, "Rooms:");
		for (ChronosRoom r : _rooms) {
			r.print(indent + 4);
		}
	}

	public Integer getDisplayDiv() {
		return _displayDiv;
	}

	public void setDisplayDiv(Integer displayDiv) {
		this._displayDiv = displayDiv;
	}

	public ChronosCourse getDisplayOverlappingCourse() {
		return _displayOverlappingCourse;
	}

	public void setDisplayOverlappingCourse(
			ChronosCourse displayOverlappingCourse) {
		this._displayOverlappingCourse = displayOverlappingCourse;
	}

}
